Home:ALL Converter>How to stop Hadoop cat: Unable to write to output stream automatically when run loop in shell?

How to stop Hadoop cat: Unable to write to output stream automatically when run loop in shell?

Ask Time:2018-08-29T19:19:58         Author:v11

Json Formatter

I want to write a loop by shell, and do 'hadoop fs -cat' command, but when it finished , it will show 'cat: Unable to write to output stream', so that it cann't go to next step in loop. and I need to using ctrl+c to stop it by manually. so how to stop Hadoop cat: Unable to write to output stream automatically when run loop in shell?

and shell is below:

 for i in {00..23}; do
     echo "$i";
     mkdir $i
     cd $i
     hadoop fs -cat hdfs://xxxx/20180816/$i/*.gz | zcat | head -60000 > tmp1
     cd -
 done

Author:v11,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52076230/how-to-stop-hadoop-cat-unable-to-write-to-output-stream-automatically-when-run
yy